<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>math (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">math</span>
</div>

<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="class_goog_math_AffineTransform.html">
          goog.math.AffineTransform</a><br/>
        <div class="class-details">Creates a 2D affine transform. An affine transform performs a linear
mapping from 2D coordinates to other 2D coordinates that preserves the
"straightness" and "parallelness" of lines.

Such a coordinate transformation can be represented by a 3 row by 3 column
matrix with an implied last row of [ 0 0 1 ]. This matrix transforms source
coordinates (x,y) into destination coordinates (x',y') by considering them
to be a column vector and multiplying the coordinate vector by the matrix
according to the following process:
<pre class="lang-js prettyprint">
     [ x']   [  m00  m01  m02  ] [ x ]   [ m00x + m01y + m02 ]
     [ y'] = [  m10  m11  m12  ] [ y ] = [ m10x + m11y + m12 ]
     [ 1 ]   [   0    0    1   ] [ 1 ]   [         1         ]
</pre>

This class is optimized for speed and minimizes calculations based on its
knowledge of the underlying matrix (as opposed to say simply performing
matrix multiplication).

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Bezier.html">
          goog.math.Bezier</a><br/>
        <div class="class-details">Object representing a cubic bezier curve.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Box.html">
          goog.math.Box</a><br/>
        <div class="class-details">Class for representing a box. A box is specified as a top, right, bottom,
and left. A box is useful for representing margins and padding.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Coordinate.html">
          goog.math.Coordinate</a><br/>
        <div class="class-details">Class for representing coordinates and positions.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Coordinate3.html">
          goog.math.Coordinate3</a><br/>
        <div class="class-details">Class for representing coordinates and positions in 3 dimensions.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_ExponentialBackoff.html">
          goog.math.ExponentialBackoff</a><br/>
        <div class="class-details"><span class='nodesc'>No description.</span></div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Integer.html">
          goog.math.Integer</a><br/>
        <div class="class-details">Constructs a two's-complement integer an array containing bits of the
integer in 32-bit (signed) pieces, given in little-endian order (i.e.,
lowest-order bits in the first piece), and the sign of -1 or 0.

See the from* functions below for other convenient ways of constructing
Integers.

The internal representation of an integer is an array of 32-bit signed
pieces, along with a sign (0 or -1) that indicates the contents of all the
other 32-bit pieces out to infinity.  We use 32-bit pieces because these are
the size of integers on which Javascript performs bit-operations.  For
operations like addition and multiplication, we split each number into 16-bit
pieces, which can easily be multiplied within Javascript's floating-point
representation without overflow or change in sign.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Line.html">
          goog.math.Line</a><br/>
        <div class="class-details">Object representing a line.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Long.html">
          goog.math.Long</a><br/>
        <div class="class-details">Constructs a 64-bit two's-complement integer, given its low and high 32-bit
values as *signed* integers.  See the from* functions below for more
convenient ways of constructing Longs.

The internal representation of a long is the two given signed, 32-bit values.
We use 32-bit pieces because these are the size of integers on which
Javascript performs bit-operations.  For operations like addition and
multiplication, we split each number into 16-bit pieces, which can easily be
multiplied within Javascript's floating-point representation without overflow
or change in sign.

In the algorithms below, we frequently reduce the negative case to the
positive case by negating the input(s) and then post-processing the result.
Note that we must ALWAYS check specially whether those values are MIN_VALUE
(-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
a positive number, it overflows back into a negative).  Not handling this
case would often result in infinite recursion.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Matrix.html">
          goog.math.Matrix</a><br/>
        <div class="class-details">Class for representing and manipulating matrices.

The entry that lies in the i-th row and the j-th column of a matrix is
typically referred to as the i,j entry of the matrix.

The m-by-n matrix A would have its entries referred to as:
  [ a0,0   a0,1   a0,2   ...   a0,j  ...  a0,n ]
  [ a1,0   a1,1   a1,2   ...   a1,j  ...  a1,n ]
  [ a2,0   a2,1   a2,2   ...   a2,j  ...  a2,n ]
  [  .      .      .            .          .   ]
  [  .      .      .            .          .   ]
  [  .      .      .            .          .   ]
  [ ai,0   ai,1   ai,2   ...   ai,j  ...  ai,n ]
  [  .      .      .            .          .   ]
  [  .      .      .            .          .   ]
  [  .      .      .            .          .   ]
  [ am,0   am,1   am,2   ...   am,j  ...  am,n ]

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Path.html">
          goog.math.Path</a><br/>
        <div class="class-details">Creates a path object. A path is a sequence of segments and may be open or
closed. Path uses the EVEN-ODD fill rule for determining the interior of the
path. A path must start with a moveTo command.

A "simple" path does not contain any arcs and may be transformed using
the <code> transform</code> method.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Range.html">
          goog.math.Range</a><br/>
        <div class="class-details">A number range.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_RangeSet.html">
          goog.math.RangeSet</a><br/>
        <div class="class-details">Constructs a new RangeSet, which can store numeric ranges.

Ranges are treated as half-closed: that is, they are exclusive of their end
value [start, end).

New ranges added to the set which overlap the values in one or more existing
ranges will be merged.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Rect.html">
          goog.math.Rect</a><br/>
        <div class="class-details">Class for representing rectangular regions.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Size.html">
          goog.math.Size</a><br/>
        <div class="class-details">Class for representing sizes consisting of a width and height. Undefined
width and height support is deprecated and results in compiler warning.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Vec2.html">
          goog.math.Vec2</a><br/>
        <div class="class-details">Class for a two-dimensional vector object and assorted functions useful for
manipulating points.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_math_Vec3.html">
          goog.math.Vec3</a><br/>
        <div class="class-details">Class for a three-dimensional vector object and assorted functions useful for
manipulation.

Inherits from goog.math.Coordinate3 so that a Vec3 may be passed in to any
function that requires a Coordinate.

</div>
 </div>
   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.angle"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">angle<span class="args">(<span class="arg">x1</span>,&nbsp;<span class="arg">y1</span>,&nbsp;<span class="arg">x2</span>,&nbsp;<span class="arg">y2</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Computes the angle between two points (x1,y1) and (x2,y2).
Angle zero points in the +X direction, 90 degrees points in the +Y
direction (down) and from there we grow clockwise towards 360 degrees.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">x1</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">x of first point.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">y1</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">y of first point.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">x2</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">x of second point.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">y2</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">y of second point.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Standardized angle in degrees of the vector from
    x1,y1 to x2,y2.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line185">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.angleDifference"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">angleDifference<span class="args">(<span class="arg">startAngle</span>,&nbsp;<span class="arg">endAngle</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Computes the difference between startAngle and endAngle (angles in degrees).

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">startAngle</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Start angle in degrees.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">endAngle</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">End angle in degrees.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The number of degrees that when added to
    startAngle will result in endAngle. Positive numbers mean that the
    direction is clockwise. Negative numbers indicate a counter-clockwise
    direction.
    The shortest route (clockwise vs counter-clockwise) between the angles
    is used.
    When the difference is 180 degrees, the function returns 180 (not -180)
    angleDifference(30, 40) is 10, and angleDifference(40, 30) is -10.
    angleDifference(350, 10) is 20, and angleDifference(10, 350) is -20.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line205">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.angleDx"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">angleDx<span class="args">(<span class="arg">degrees</span>,&nbsp;<span class="arg">radius</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       For a given angle and radius, finds the X portion of the offset.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">degrees</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Angle in degrees (zero points in +X direction).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">radius</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Radius.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The x-distance for the angle and radius.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line158">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.angleDy"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">angleDy<span class="args">(<span class="arg">degrees</span>,&nbsp;<span class="arg">radius</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       For a given angle and radius, finds the Y portion of the offset.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">degrees</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Angle in degrees (zero points in +X direction).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">radius</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Radius.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The y-distance for the angle and radius.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line169">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.average"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">average<span class="args">(<span class="arg">var_args</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the arithmetic mean of the arguments.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">var_args</span>
        : <span class="type">...number</span>
        <div class="entryOverview">Numbers to average.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The average of the arguments (<code> NaN</code> if no arguments
    were provided or any of the arguments is not a valid number).
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line321">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.clamp"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">clamp<span class="args">(<span class="arg">value</span>,&nbsp;<span class="arg">min</span>,&nbsp;<span class="arg">max</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Takes a number and clamps it to within the provided bounds.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">value</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The input number.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">min</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The minimum value to return.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">max</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The maximum value to return.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The input number if it is within bounds, or the nearest
    number within the bounds.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line55">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.isFiniteNumber"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">isFiniteNumber<span class="args">(<span class="arg">num</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Returns whether the supplied number is finite and not NaN.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">num</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The number to test.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether <code> num</code> is a finite number.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line380">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.isInt"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">isInt<span class="args">(<span class="arg">num</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Returns whether the supplied number represents an integer, i.e. that is has
no fractional component.  No range-checking is performed on the number.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">num</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The number to test.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether <code> num</code> is an integer.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line370">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.lerp"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">lerp<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>,&nbsp;<span class="arg">x</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Performs linear interpolation between values a and b. Returns the value
between a and b proportional to x (when x is between 0 and 1. When x is
outside this range, the return value is a linear extrapolation).

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">A number.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">A number.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">x</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The proportion between a and b.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The interpolated value between a and b.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line89">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.log10Floor"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">log10Floor<span class="args">(<span class="arg">num</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the precise value of floor(log10(num)).
Simpler implementations didn't work because of floating point rounding
errors. For example
<ul><li>Math.floor(Math.log(num) / Math.LN10) is off by one for num == 1e+3.
<li>Math.floor(Math.log(num) * Math.LOG10E) is off by one for num == 1e+15.
<li>Math.floor(Math.log10(num)) is off by one for num == 1e+15 - 1.
</li></li></li></ul>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">num</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">A floating point number.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Its logarithm to base 10 rounded down to the nearest
    integer if num &gt; 0. -Infinity if num == 0. NaN if num &lt; 0.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line398">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.longestCommonSubsequence"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">longestCommonSubsequence<span class="args">(<span class="arg">array1</span>,&nbsp;<span class="arg">array2</span>,&nbsp;<span class="arg">opt_compareFn</span>,&nbsp;<span class="arg">opt_collectorFn</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>&gt;
      </div>


     <div class="entryOverview">
       JavaScript implementation of Longest Common Subsequence problem.
<a href="http://en.wikipedia.org/wiki/Longest_common_subsequence">http://en.wikipedia.org/wiki/Longest_common_subsequence</a>

Returns the longest possible array that is subarray of both of given arrays.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">array1</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>&gt;
        <div class="entryOverview">First array of objects.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">array2</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>&gt;
        <div class="entryOverview">Second array of objects.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_compareFn</span>
        : <span class="type">Function=</span>
        <div class="entryOverview">Function that acts as a custom comparator
    for the array ojects. Function should return true if objects are equal,
    otherwise false.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_collectorFn</span>
        : <span class="type">Function=</span>
        <div class="entryOverview">Function used to decide what to return
    as a result subsequence. It accepts 2 arguments: index of common element
    in the first array and index in the second. The default function returns
    element from the first array.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>&gt;&nbsp;
            A list of objects that are common to both arrays
    such that there is no common subsequence with size greater than the
    length of the list.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line246">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.modulo"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">modulo<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       The % operator in JavaScript returns the remainder of a / b, but differs from
some other languages in that the result will have the same sign as the
dividend. For example, -1 % 8 == -1, whereas in some other languages
(such as Python) the result would be 7. This function emulates the more
correct modulo behavior, which is useful for certain applications such as
calculating an offset index in a circular list.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The dividend.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The divisor.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            a % b where the result is between 0 and b (either 0 &lt;= x &lt; b
    or b &lt; x &lt;= 0, depending on the sign of b).
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line73">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.nearlyEquals"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">nearlyEquals<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>,&nbsp;<span class="arg">opt_tolerance</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Tests whether the two values are equal to each other, within a certain
tolerance to adjust for floating point errors.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">A number.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">A number.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_tolerance</span>
        : <span class="type">number=</span>
        <div class="entryOverview">Optional tolerance range. Defaults
    to 0.000001. If specified, should be greater than 0.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether <code> a</code> and <code> b</code> are nearly equal.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line103">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.randomInt"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">randomInt<span class="args">(<span class="arg">a</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns a random integer greater than or equal to 0 and less than <code> a</code>.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The upper bound for the random integer (exclusive).</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            A random integer N such that 0 &lt;= N &lt; a.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line30">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.safeCeil"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">safeCeil<span class="args">(<span class="arg">num</span>,&nbsp;<span class="arg">opt_epsilon</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       A tweaked variant of <code> Math.ceil</code>. See <code> goog.math.safeFloor</code> for
details.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">num</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">A number.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_epsilon</span>
        : <span class="type">number=</span>
        <div class="entryOverview">An infinitesimally small positive number, the
    rounding error to tolerate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The smallest integer greater than or equal to <code> num</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line432">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.safeFloor"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">safeFloor<span class="args">(<span class="arg">num</span>,&nbsp;<span class="arg">opt_epsilon</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       A tweaked variant of <code> Math.floor</code> which tolerates if the passed number
is infinitesimally smaller than the closest integer. It often happens with
the results of floating point calculations because of the finite precision
of the intermediate results. For example <code> Math.floor(Math.log(1000) /
Math.LN10) == 2</code>, not 3 as one would expect.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">num</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">A number.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_epsilon</span>
        : <span class="type">number=</span>
        <div class="entryOverview">An infinitesimally small positive number, the
    rounding error to tolerate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The largest integer less than or equal to <code> num</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line418">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.sampleVariance"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">sampleVariance<span class="args">(<span class="arg">var_args</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the unbiased sample variance of the arguments. For a definition,
see e.g. <a href="http://en.wikipedia.org/wiki/Variance">http://en.wikipedia.org/wiki/Variance</a>

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">var_args</span>
        : <span class="type">...number</span>
        <div class="entryOverview">Number samples to analyze.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The unbiased sample variance of the arguments (0 if fewer
    than two samples were provided, or <code> NaN</code> if any of the samples is
    not a valid number).
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line334">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.sign"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">sign<span class="args">(<span class="arg">x</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the sign of a number as per the "sign" or "signum" function.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">x</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The number to take the sign of.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            -1 when negative, 1 when positive, 0 when 0.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line222">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.standardAngle"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">standardAngle<span class="args">(<span class="arg">angle</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Normalizes an angle to be in range [0-360). Angles outside this range will
be normalized to be the equivalent angle with that range.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">angle</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Angle in degrees.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Standardized angle.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line116">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.standardAngleInRadians"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">standardAngleInRadians<span class="args">(<span class="arg">angle</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Normalizes an angle to be in range [0-2*PI). Angles outside this range will
be normalized to be the equivalent angle with that range.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">angle</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Angle in radians.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Standardized angle.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line127">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.standardDeviation"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">standardDeviation<span class="args">(<span class="arg">var_args</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the sample standard deviation of the arguments.  For a definition of
sample standard deviation, see e.g.
<a href="http://en.wikipedia.org/wiki/Standard_deviation">http://en.wikipedia.org/wiki/Standard_deviation</a>

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">var_args</span>
        : <span class="type">...number</span>
        <div class="entryOverview">Number samples to analyze.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The sample standard deviation of the arguments (0 if fewer
    than two samples were provided, or <code> NaN</code> if any of the samples is
    not a valid number).
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line359">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.sum"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">sum<span class="args">(<span class="arg">var_args</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the sum of the arguments.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">var_args</span>
        : <span class="type">...number</span>
        <div class="entryOverview">Numbers to add.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The sum of the arguments (0 if no arguments were provided,
    <code> NaN</code> if any of the arguments is not a valid number).
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line307">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.toDegrees"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">toDegrees<span class="args">(<span class="arg">angleRadians</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Converts radians to degrees.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">angleRadians</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Angle in radians.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Angle in degrees.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line147">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.toRadians"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">toRadians<span class="args">(<span class="arg">angleDegrees</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Converts degrees to radians.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">angleDegrees</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Angle in degrees.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Angle in radians.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line137">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.uniformRandom"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">uniformRandom<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns a random number greater than or equal to <code> a</code> and less than
<code> b</code>.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The lower bound for the random number (inclusive).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The upper bound for the random number (exclusive).</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            A random number N such that a &lt;= N &lt; b.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_math.js.source.html#line42">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



  <h2>Global Properties</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.AffineTransformTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">AffineTransformTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_affinetransform_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.BezierTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">BezierTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_bezier_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.BoxTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">BoxTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_box_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.Coordinate3Test"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">Coordinate3Test</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate3_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.CoordinateTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">CoordinateTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.ExponentialBackoffTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">ExponentialBackoffTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_exponentialbackoff_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.IntegerTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">IntegerTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_integer_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.LineTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">LineTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_line_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.LongTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">LongTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_long_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.MatrixTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">MatrixTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_matrix_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.PathTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">PathTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_path_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.RangeSetTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">RangeSetTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_rangeset_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.RangeTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">RangeTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_range_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.RectTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">RectTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_rect_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.SizeTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">SizeTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_size_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.Vec2Test"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">Vec2Test</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_vec2_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.Vec3Test"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">Vec3Test</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_vec3_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.interpolator"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">interpolator</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_interpolator_interpolator1.js.source.html#line20">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.paths"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">paths</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_paths.js.source.html#line22">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.pathsTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">pathsTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_paths_test.js.source.html#line19">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.tdma"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">tdma</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_tdma.js.source.html#line23">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.tdmaTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.</span><span class="entryName">tdmaTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_tdma_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package math</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="math"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
